/*
 * User: user
 * Date: 21/12/2007
 * Time: 00:43:46
 */
package org.conann.metadata.scanning;

import org.conann.metadata.records.Record;
import org.conann.metadata.validation.ValidationHandler;
import static org.conann.util.AnnotationUtil.getRelevantAnnotations;

import java.lang.reflect.AnnotatedElement;

public abstract class ElementScanner<R extends Record<?>, E extends AnnotatedElement> implements Scanner<R, E> {

    protected void validate(R record) {
        ValidationHandler.getInstance().validate(record);
    }

    public boolean isRelevant(E element) {
        return !getRelevantAnnotations(element).isEmpty();
    }

    // TODO ophir >> remove from here, should be abstract but silly maven's compiler doesn't like it
    public R scan(E element) {
        return null;
    }
}